package org.hazelnuts.accessor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Component;

@Component
public class OracleJdbcAccessor {

    @Autowired
    private JdbcTemplate oracleJdbcTemple;

    public int create(String sqlString, @Nullable Object... args) {
        return oracleJdbcTemple.update(sqlString, args);
    }

    public int query() {
        return oracleJdbcTemple.queryForList("SELECT 1 FROM DUAL", Integer.class).get(0);
    }
}
